using FrameworkDesign;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class BtnManager : ItemViewController
{
    public Button AddItem1;
    public Button AddItem2;
    public Button AddItem3;
    public Button AddItem4;
    public Button SubItem1;
    public Button SubItem2;
    public Button SubItem3;
    public Button SubItem4;
    private IItemSystme itemSystme;
    // Start is called before the first frame update
    void Start()
    {

        itemSystme=this.GetSystem<IItemSystme>();
        var constModel = this.GetModel<IConstModel>();
        AddItem1.onClick.AddListener(() => itemSystme.AddItem("GreenSword", constModel.GetItemSlotGroupName));
        AddItem2.onClick.AddListener(() => itemSystme.AddItem("Potion", constModel.GetItemSlotGroupName));
        AddItem3.onClick.AddListener(() => itemSystme.AddItem("", constModel.GetItemSlotGroupName));
        AddItem4.onClick.AddListener(() => itemSystme.AddItem(ItemKit.item4.Key, constModel.GetItemSlotGroupName));
        SubItem1.onClick.AddListener(() => itemSystme.SubItem("GreenSword", constModel.GetItemSlotGroupName));
        SubItem2.onClick.AddListener(() => itemSystme.SubItem("Potion", constModel.GetItemSlotGroupName));
        SubItem3.onClick.AddListener(() => itemSystme.SubItem(ItemKit.item3.Key,constModel.GetItemSlotGroupName));
        SubItem4.onClick.AddListener(() => itemSystme.SubItem(ItemKit.item4.Key, constModel.GetItemSlotGroupName));




    }

    // Update is called once per frame
    void Update()
    {

    }
}
